super.sessionEnding(session); IWidget[] frames = session.getApplication().getMainFrame().getDesktopContainer().getAllWidgets(); for (int i = 0; i < frames.length; i++) { if (frames[i] instanceof SmarttoolFindBadNullValuesFrame || frames[i] instanceof SmarttoolChangeValuesFrame || frames[i] instanceof SmarttoolMissingIndicesFrame ) { frames[i].dispose(); } }
super.sessionEnding(session); IWidget[] frames = session.getApplication().getMainFrame().getDesktopContainer().getAllWidgets(); for (int i = 0; i < frames.length; i++) { if (frames[i] instanceof FirebirdManagerGrantFrame || frames[i] instanceof FirebirdManagerRoleFrame) { frames[i].dispose(); } }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/smarttools/src/net/sourceforge/squirrel_sql/plugins/smarttools/SmarttoolsPlugin.java File path: /sql12/plugins/firebirdmanager/src/net/sourceforge/squirrel_sql/plugins/firebirdmanager/FirebirdManagerPlugin.java
Method name: void sessionEnding(ISession) Method name: void sessionEnding(ISession)
Number of AST nodes: 5 Number of AST nodes: 5
1
super.sessionEnding(session);
1
super.sessionEnding(session);
2
		IWidget[] frames = session.getApplication().getMainFrame().getDesktopContainer().getAllWidgets();
2
		IWidget[] frames = session.getApplication().getMainFrame().getDesktopContainer().getAllWidgets();
3
		for (int i = 0; i < frames.length; i++) {
3
		for (int i = 0; i < frames.length; i++) {
4
			if (frames[i] instanceof SmarttoolFindBadNullValuesFrame
4
			if (frames[i] instanceof FirebirdManagerGrantFrame
5
					|| frames[i] instanceof SmarttoolChangeValuesFrame
5
				|| frames[i] instanceof 
6
					|| frames[i] instanceof SmarttoolMissingIndicesFrame
7
				) {
6
FirebirdManagerRoleFrame) {
8
				frames[i].dispose();
7
				frames[i].dispose();
9
			}
8
			}
10
		}
9
		}
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.6
Clones locationClones are in different classes having the same super class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.1
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    super.sessionEnding(session);
    1
    super.sessionEnding(session);
    1
    super.sessionEnding(session);
    Preondition Violations
    Super method call super.sessionEnding(session); cannot be extracted from method
    Super method call super.sessionEnding(session); cannot be extracted from method
    1
    super.sessionEnding(session);
    2
    IWidget[] frames = session.getApplication().getMainFrame().getDesktopContainer().getAllWidgets();
    2
    IWidget[] frames = session.getApplication().getMainFrame().getDesktopContainer().getAllWidgets();
    3
    for (int i = 0; i < frames.length; i++)
    3
    for (int i = 0; i < frames.length; i++)
    4
    if (frames[i] instanceof SmarttoolFindBadNullValuesFrame || frames[i] instanceof SmarttoolChangeValuesFrame || frames[i] instanceof SmarttoolMissingIndicesFrame)
    4
    if (frames[i] instanceof SmarttoolFindBadNullValuesFrame || frames[i] instanceof SmarttoolChangeValuesFrame || frames[i] instanceof SmarttoolMissingIndicesFrame)
    4
    if (frames[i] instanceof FirebirdManagerGrantFrame || frames[i] instanceof FirebirdManagerRoleFrame)
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.smarttools.gui.SmarttoolFindBadNullValuesFramenet.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerGrantFrameSUBCLASS_TYPE_MISMATCH
    net.sourceforge.squirrel_sql.plugins.smarttools.gui.SmarttoolChangeValuesFramenet.sourceforge.squirrel_sql.plugins.firebirdmanager.gui.FirebirdManagerRoleFrameSUBCLASS_TYPE_MISMATCH
    frames[i] instanceof SmarttoolFindBadNullValuesFrame || frames[i] instanceof SmarttoolChangeValuesFrame || frames[i] instanceof SmarttoolMissingIndicesFrameframes[i] instanceof FirebirdManagerGrantFrame || frames[i] instanceof FirebirdManagerRoleFrameINFIX_EXTENDED_OPERAND_NUMBER_MISMATCH
    Preondition Violations
    Expression frames[i] instanceof SmarttoolFindBadNullValuesFrame cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression frames[i] instanceof FirebirdManagerGrantFrame cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression frames[i] instanceof SmarttoolChangeValuesFrame cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression frames[i] instanceof FirebirdManagerRoleFrame cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression frames[i] instanceof SmarttoolFindBadNullValuesFrame || frames[i] instanceof SmarttoolChangeValuesFrame || frames[i] instanceof SmarttoolMissingIndicesFrame cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression frames[i] instanceof FirebirdManagerGrantFrame || frames[i] instanceof FirebirdManagerRoleFrame cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    if (frames[i] instanceof FirebirdManagerGrantFrame || frames[i] instanceof FirebirdManagerRoleFrame)
    5
    frames[i].dispose();
    5
    frames[i].dispose();
    Precondition Violations (8)
    Row Violation
    1Super method call super.sessionEnding(session); cannot be extracted from method
    2Super method call super.sessionEnding(session); cannot be extracted from method
    3Expression frames[i] instanceof SmarttoolFindBadNullValuesFrame cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4Expression frames[i] instanceof FirebirdManagerGrantFrame cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5Expression frames[i] instanceof SmarttoolChangeValuesFrame cannot be parameterized, because it has dependencies to/from statements that will be extracted
    6Expression frames[i] instanceof FirebirdManagerRoleFrame cannot be parameterized, because it has dependencies to/from statements that will be extracted
    7Expression frames[i] instanceof SmarttoolFindBadNullValuesFrame || frames[i] instanceof SmarttoolChangeValuesFrame || frames[i] instanceof SmarttoolMissingIndicesFrame cannot be parameterized, because it has dependencies to/from statements that will be extracted
    8Expression frames[i] instanceof FirebirdManagerGrantFrame || frames[i] instanceof FirebirdManagerRoleFrame cannot be parameterized, because it has dependencies to/from statements that will be extracted