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
{
//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/ConvertToStringBufferAction.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: 3
|
|
Number of AST nodes: 3
|
|
1 | if (_session != null)↵ | | 1 | if (_session != null)↵
|
2 | {↵ | | 2 | {↵
|
3 | try↵ | | 3 | try↵
|
4 | {↵ | | 4 | {↵
|
|
5 | //new ConvertToStringBufferCommand(_session.getSQLPanelAPI(_plugin)).execute();↵ | | 5 | //new RemoveQuotesCommand(_session.getSQLPanelAPI(_plugin)).execute();↵
|
6 | new ConvertToStringBufferCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute();↵ | | 6 | new RemoveQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute();↵
|
7 | }↵ | | 7 | }↵
|
8 | catch (Throwable ex)↵ | | 8 | catch (Throwable ex)↵
|
9 | {↵ | | 9 | {↵
|
10 | // i18n[editextras.convertStringBufErr=Error executing convert to StringBuffer command: {0}]↵ | | 10 | // i18n[editextras.errorRemoveQuotes=Error processing Remove Quotes SQL command: {0}]↵
|
11 | final String msg = s_stringMgr.getString("editextras.convertStringBufErr", ex);↵ | | 11 | final String msg = s_stringMgr.getString("editextras.errorRemoveQuotes", ex);↵
|
|
12 | _session.showErrorMessage(msg);↵ | | 12 | _session.showErrorMessage(msg);↵
|
13 | s_log.error(msg, ex);↵ | | 13 | s_log.error(msg, ex);↵
|
14 | }↵ | | 14 | }↵
|
15 | } | | 15 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 5 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 6.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (_session != null) | | 1 | if (_session != null) |
2 | | | 2 | |
3 | new ConvertToStringBufferCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute(); | | 3 | new RemoveQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute(); |
Precondition Violations (2)
Row |
Violation |
1 | Expression new ConvertToStringBufferCommand(FrameWorkAcessor.getSQLPanelAPI(_session,_plugin)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression new RemoveQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session,_plugin)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |