NetbeansSQLEntryPanel panel = _panels.get(id); if (panel != null) { panel.sessionEnding(); } _panels.remove(id);
Insets ins = border.getBorderInsets(this); if (ins != null) { _prefSize.width += (ins.left + ins.right); }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/netbeans/NetbeansSQLEntryAreaFactory.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/gui/TimePanel.java
Method name: void sessionEnding(ISession) Method name: Dimension getPreferredSize()
Number of AST nodes: 4 Number of AST nodes: 3
1
NetbeansSQLEntryPanel panel = _panels.get(id);
1
Insets ins = border.getBorderInsets(this);
2
			if (panel != null)
2
				if (ins != null)
3
			{
3
				{
4
				panel.sessionEnding();
4
				
5
			}
6
			_panels.remove(id);
5
	_prefSize.width += (ins.left + ins.right);
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 comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    Number of unmapped statements in the first code fragment3
    Number of unmapped statements in the second code fragment2
    Time elapsed for statement mapping (ms)0.7
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    4
    NetbeansSQLEntryPanel panel = _panels.get(id);
                                                                                                  
                                                                                            
    12
    Insets ins = border.getBorderInsets(this);
    5
    if (panel != null)
    5
    if (panel != null)
    13
    if (ins != null)
    Differences
    Expression1Expression2Difference
    panelinsVARIABLE_NAME_MISMATCH
    net.sourceforge.squirrel_sql.plugins.syntax.netbeans.NetbeansSQLEntryPaneljava.awt.InsetsVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type net.sourceforge.squirrel_sql.plugins.syntax.netbeans.NetbeansSQLEntryPanel of variable panel does not match with type java.awt.Insets of variable ins
    • Make classes net.sourceforge.squirrel_sql.plugins.syntax.netbeans.NetbeansSQLEntryPanel and java.awt.Insets extend a common superclass
    13
    if (ins != null)
    6
    panel.sessionEnding();
    6
    panel.sessionEnding();
    Preondition Violations
    Unmatched statement panel.sessionEnding(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
                                                      
                                                                                            
    14
    _prefSize.width += (ins.left + ins.right);
    Preondition Violations
    Unmatched statement _prefSize.width+=(ins.left + ins.right); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    14
    _prefSize.width += (ins.left + ins.right);
    7
    _panels.remove(id);
                                                
    Precondition Violations (4)
    Row Violation
    1Type net.sourceforge.squirrel_sql.plugins.syntax.netbeans.NetbeansSQLEntryPanel of variable panel does not match with type java.awt.Insets of variable ins
    2Unmatched statement panel.sessionEnding(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched statement _prefSize.width+=(ins.left + ins.right); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    4The refactoring of the clones is infeasible, because the number of macthed statements is equal to zero