if (_session != null) { try { //new InQuotesCommand(_session.getSQLPanelAPI(_plugin)).execute(); new InQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute(); } catch (Throwable ex) { // i18n[editextras.errorQuoteSql=Error processing Quote SQL command: {0}] final String msg = s_stringMgr.getString("editextras.errorQuoteSql", 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/InQuotesAction.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 InQuotesCommand(_session.getSQLPanelAPI(_plugin)).execute();
6
				new InQuotesCommand(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
				
8
 {
12
// i18n[editextras.errorQuoteSql=Error processing Quote
9
                // i18n[editextras.errorRemoveNewLines=Error processing Remove
13
 SQL command: {0}]
10
                // NewLines SQL command: {0}]
14
				final String msg = s_stringMgr.getString("editextras.errorQuoteSql", ex);
11
                final String msg = s_stringMgr.getString(
15
				
12
                        "editextras.errorRemoveNewLines", ex);
16
_session.showErrorMessage(msg);
13
                _session.showErrorMessage(msg);
17
				s_log.error(msg, ex);
14
                s_log.error(msg, ex);
18
			}
19
		
15
            }
20
}
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.4
    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.errorQuoteSql""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 InQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute();
    3
    new InQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute();
    4
    command.execute();
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.editextras.InQuotesCommandnet.sourceforge.squirrel_sql.plugins.editextras.RemoveNewLinesCommandSUBCLASS_TYPE_MISMATCH
    new InQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session,_plugin))commandTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression new InQuotesCommand(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 InQuotesCommand(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