if (_session != null) { try { new CloseSessionCommand(_session).execute(); } catch (Throwable ex) { final String msg = "Error occured closing session"; _session.showErrorMessage(msg + ": " + ex); s_log.error(msg, ex); } }
if (_session != null) { try { new CloseSessionWindowCommand(_session).execute(); } catch (Throwable ex) { final String msg = "Error occured closing session"; _session.showErrorMessage(msg + ": " + ex); s_log.error(msg, ex); } }
Clone fragments detected by clone detection tool
File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/action/CloseSessionAction.java File path: /sql12/app/src/net/sourceforge/squirrel_sql/client/session/action/CloseSessionWindowAction.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (_session != null)
1
if (_session != null)
2
		{
2
		{
3
			try
3
			try
4
			{
4
			{
5
				new CloseSessionCommand(_session).execute();
5
            new CloseSessionWindowCommand(_session).execute();
6
			}
6
			}
7
			catch (Throwable ex)
7
			catch (Throwable ex)
8
			{
8
			{
9
				final String msg = "Error occured closing session";
9
				final String msg = "Error occured closing session";
10
				_session.showErrorMessage(msg + ": " + ex);
10
				_session.showErrorMessage(msg + ": " + ex);
11
				s_log.error(msg, ex);
11
				s_log.error(msg, ex);
12
			}
12
			}
13
		}
13
		}
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons5
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements3
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (_session != null)
    1
    if (_session != null)
    2
    try
    2
    try
    3
    new CloseSessionCommand(_session).execute();
    3
    new CloseSessionCommand(_session).execute();
    3
    new CloseSessionWindowCommand(_session).execute();
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.client.session.action.CloseSessionCommandnet.sourceforge.squirrel_sql.client.session.action.CloseSessionWindowCommandSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression new CloseSessionCommand(_session) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new CloseSessionWindowCommand(_session) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    new CloseSessionWindowCommand(_session).execute();
    Precondition Violations (2)
    Row Violation
    1Expression new CloseSessionCommand(_session) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression new CloseSessionWindowCommand(_session) cannot be parameterized, because it has dependencies to/from statements that will be extracted