final MainFrame mf = getMainFrame(); if (mf != null) { mf.addToStatusBar(comp); } else { throw new IllegalStateException(s_stringMgr.getString("Application.error.compadding")); }
final MainFrame mf = getMainFrame(); if (mf != null) { mf.removeFromStatusBar(comp); } else { throw new IllegalStateException(s_stringMgr.getString("Application.error.compremoving")); }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/Application.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/Application.java
Method name: void addToStatusBar(JComponent) Method name: void removeFromStatusBar(JComponent)
Number of AST nodes: 4 Number of AST nodes: 4
1
final MainFrame mf = getMainFrame();
1
final MainFrame mf = getMainFrame();
2
		if (mf != null)
2
		if (mf != null)
3
		{
3
		{
4
			mf.addToStatusBar(comp);
4
			mf.removeFromStatusBar(comp);
5
		}
5
		}
6
		else
6
		else
7
		{
7
		{
8
			throw new IllegalStateException(s_stringMgr.getString("Application.error.compadding"));
8
			throw new IllegalStateException(s_stringMgr.getString("Application.error.compremoving"));
9
		}
9
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.1
Clones locationClones are declared in the same class
Number of node comparisons10
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)26.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    final MainFrame mf = getMainFrame();
    1
    final MainFrame mf = getMainFrame();
    2
    if (mf != null)
    2
    if (mf != null)
    3
    mf.addToStatusBar(comp);
    3
    mf.addToStatusBar(comp);
    3
    mf.removeFromStatusBar(comp);
    Differences
    Expression1Expression2Difference
    addToStatusBarremoveFromStatusBarMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression mf.addToStatusBar(comp) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mf.removeFromStatusBar(comp) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression mf.addToStatusBar(comp) is a void method call, and thus it cannot be parameterized
    Expression mf.removeFromStatusBar(comp) is a void method call, and thus it cannot be parameterized
    3
    mf.removeFromStatusBar(comp);
    else
    else
    4
    throw new IllegalStateException(s_stringMgr.getString("Application.error.compadding"));
    4
    throw new IllegalStateException(s_stringMgr.getString("Application.error.compadding"));
    4
    throw new IllegalStateException(s_stringMgr.getString("Application.error.compremoving"));
    Differences
    Expression1Expression2Difference
    "Application.error.compadding""Application.error.compremoving"LITERAL_VALUE_MISMATCH
    4
    throw new IllegalStateException(s_stringMgr.getString("Application.error.compremoving"));
    Precondition Violations (4)
    Row Violation
    1Expression mf.addToStatusBar(comp) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression mf.removeFromStatusBar(comp) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression mf.addToStatusBar(comp) is a void method call, and thus it cannot be parameterized
    4Expression mf.removeFromStatusBar(comp) is a void method call, and thus it cannot be parameterized