final MainFrame mf = getMainFrame(); if (mf != null) { mf.addToMenu(menuId, menu); } else { throw new IllegalStateException(s_stringMgr.getString("Application.error.menuadding")); }
final MainFrame mf = getMainFrame(); if (mf != null) { mf.addToMenu(menuId, action); } else { throw new IllegalStateException(s_stringMgr.getString("Application.error.menuadding")); }
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 addToMenu(int, JMenu) Method name: void addToMenu(int, Action)
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.addToMenu(menuId, menu);
4
			mf.addToMenu(menuId, action);
5
		}
5
		}
6
		else
6
		else
7
		{
7
		{
8
			throw new IllegalStateException(s_stringMgr.getString("Application.error.menuadding"));
8
			throw new IllegalStateException(s_stringMgr.getString("Application.error.menuadding"));
9
		}
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.1
Clones locationClones are declared in the same class
Number of node comparisons10
  1. {Non-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)1.4
    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.addToMenu(menuId, menu);
    3
    mf.addToMenu(menuId, menu);
    3
    mf.addToMenu(menuId, action);
    Differences
    Expression1Expression2Difference
    menuactionVARIABLE_NAME_MISMATCH
    javax.swing.JMenujavax.swing.ActionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type javax.swing.JMenu of variable menu does not match with type javax.swing.Action of variable action
    • Make classes javax.swing.JMenu and javax.swing.Action extend a common superclass
    3
    mf.addToMenu(menuId, action);
    else
    else
    4
    throw new IllegalStateException(s_stringMgr.getString("Application.error.menuadding"));
    4
    throw new IllegalStateException(s_stringMgr.getString("Application.error.menuadding"));
    Precondition Violations (1)
    Row Violation
    1Type javax.swing.JMenu of variable menu does not match with type javax.swing.Action of variable action