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); } }
if (_session != null) { try { //new RemoveQuotesCommand(_session.getSQLPanelAPI(_plugin)).execute(); new RemoveQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute(); } catch (Throwable ex) { // i18n[editextras.errorRemoveQuotes=Error processing Remove Quotes SQL command: {0}] final String msg = s_stringMgr.getString("editextras.errorRemoveQuotes", 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/RemoveNewLlinesAction.java File path: /sql12/plugins/editextras/src/net/sourceforge/squirrel_sql/plugins/editextras/RemoveQuotesAction.java
Method name: void actionPerformed(ActionEvent) Method name: void actionPerformed(ActionEvent)
Number of AST nodes: 4 Number of AST nodes: 3
1
if (_session != null) {
1
if (_session != null)
2
            try {
3
               
2
		{
3
			try
4
			{
4
 RemoveNewLinesCommand command = 
5
				//new RemoveQuotesCommand(_session.getSQLPanelAPI(_plugin)).execute();
5
new RemoveNewLinesCommand(
6
				new RemoveQuotesCommand(
6
                        FrameWorkAcessor.getSQLPanelAPI(_session, _plugin));
7
FrameWorkAcessor.getSQLPanelAPI(_session, _plugin))
7
                command.execute();
8
            } 
8
.execute();
9
			}
9
catch (Throwable ex) {
10
			catch (Throwable ex)
10
                
11
			{
11
// i18n[editextras.errorRemoveNewLines=Error processing Remove
12
				// i18n[editextras.errorRemoveQuotes=Error processing Remove
12
                // NewLines SQL command: {0}]
13
 Quotes SQL command: {0}]
13
                final String msg = s_stringMgr.getString(
14
				final String msg = s_stringMgr.getString(
14
                        "editextras.errorRemoveNewLines", ex);
15
"editextras.errorRemoveQuotes", ex);
15
                _session.showErrorMessage(msg);
16
				_session.showErrorMessage(msg);
16
                s_log.error(msg, ex);
17
				s_log.error(msg, ex);
17
            }
18
        
18
			}
19
}
19
		}
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 fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)7.2
    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.errorRemoveNewLines""editextras.errorRemoveQuotes"LITERAL_VALUE_MISMATCH
    2
    try
    3
    RemoveNewLinesCommand command = new RemoveNewLinesCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin));
    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
                                                                                                                                                                                                                                
    4
    command.execute();
    4
    command.execute();
    3
    new RemoveQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute();
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.editextras.RemoveNewLinesCommandnet.sourceforge.squirrel_sql.plugins.editextras.RemoveQuotesCommandSUBCLASS_TYPE_MISMATCH
    commandnew RemoveQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session,_plugin))TYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression command cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression new RemoveQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session,_plugin)) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3
    new RemoveQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).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 command cannot be parameterized, because it has dependencies to/from statements that will be extracted
    3Expression new RemoveQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session,_plugin)) cannot be parameterized, because it has dependencies to/from statements that will be extracted