if (_session != null) { try { //new ConvertToStringBufferCommand(_session.getSQLPanelAPI(_plugin)).execute(); new ConvertToStringBufferCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute(); } catch (Throwable ex) { // i18n[editextras.convertStringBufErr=Error executing convert to StringBuffer command: {0}] final String msg = s_stringMgr.getString("editextras.convertStringBufErr", ex); _session.showErrorMessage(msg); s_log.error(msg, ex); } }
if (_session != null) { try { RemoveNewLinesCommand command = new RemoveNewLinesCommand( FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)); command.execute(); } catch (Throwable ex) { // i18n[editextras.errorRemoveNewLines=Error processing Remove // NewLines SQL command: {0}] final String msg = s_stringMgr.getString( "editextras.errorRemoveNewLines", ex); _session.showErrorMessage(msg); s_log.error(msg, ex); } }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/editextras/src/net/sourceforge/squirrel_sql/plugins/editextras/ConvertToStringBufferAction.java File path: /sql12/plugins/editextras/src/net/sourceforge/squirrel_sql/plugins/editextras/RemoveNewLlinesAction.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 3 Number of AST nodes: 4
1
if (_session != null)
1
if (_session != null)
2
		{
3
			try
4
			{
5
				//new ConvertToStringBufferCommand(_session.getSQLPanelAPI(_plugin)).execute();
6
				new ConvertToStringBufferCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute();
7
			}
8
			
2
 {
3
            try {
4
                RemoveNewLinesCommand command = new RemoveNewLinesCommand(
5
                        FrameWorkAcessor.getSQLPanelAPI(_session, _plugin));
6
                command.execute();
9
catch (Throwable ex)
7
            } catch (Throwable ex)
10
			{
11
				// i18n[editextras.convertStringBufErr=Error executing convert to StringBuffer command: {0}]
12
				
8
 {
9
                // i18n[editextras.errorRemoveNewLines=Error processing Remove
10
                // NewLines SQL command: {0}]
13
final String msg = s_stringMgr.getString("editextras.convertStringBufErr", ex);
11
                final String msg = s_stringMgr.getString(
14
				
12
                        "editextras.errorRemoveNewLines", ex);
15
_session.showErrorMessage(msg);
13
                _session.showErrorMessage(msg);
16
				s_log.error(msg, ex);
14
                s_log.error(msg, ex);
17
			}
18
		
15
            }
19
}
16
        }
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.4
Clones locationClones are in different classes having the same super class
Number of node comparisons7
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)7.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    if (_session != null)
    1
    if (_session != null)
    2
    try
    2
    try
    2
    try
    Differences
    Expression1Expression2Difference
    "editextras.convertStringBufErr""editextras.errorRemoveNewLines"LITERAL_VALUE_MISMATCH
    2
    try
                                                                                                                                                                                                                                
    3
    RemoveNewLinesCommand command = new RemoveNewLinesCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin));
    Preondition Violations
    Unmatched statement RemoveNewLinesCommand command=new RemoveNewLinesCommand(FrameWorkAcessor.getSQLPanelAPI(_session,_plugin)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3
    RemoveNewLinesCommand command = new RemoveNewLinesCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin));
    3
    new ConvertToStringBufferCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute();
    3
    new ConvertToStringBufferCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute();
    4
    command.execute();
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.editextras.ConvertToStringBufferCommandnet.sourceforge.squirrel_sql.plugins.editextras.RemoveNewLinesCommandSUBCLASS_TYPE_MISMATCH
    new ConvertToStringBufferCommand(FrameWorkAcessor.getSQLPanelAPI(_session,_plugin))commandTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression new ConvertToStringBufferCommand(FrameWorkAcessor.getSQLPanelAPI(_session,_plugin)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression command cannot be parameterized, because it has dependencies to/from statements that will be extracted
    4
    command.execute();
    Precondition Violations (3)
    Row Violation
    1Unmatched statement RemoveNewLinesCommand command=new RemoveNewLinesCommand(FrameWorkAcessor.getSQLPanelAPI(_session,_plugin)); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Expression new ConvertToStringBufferCommand(FrameWorkAcessor.getSQLPanelAPI(_session,_plugin)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression command cannot be parameterized, because it has dependencies to/from statements that will be extracted