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 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
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 | 7 |
-
{Non-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 | 1 |
Time elapsed for statement mapping (ms) | 7.4 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (_session != null) | | 1 | if (_session != null) |
2 | | | 2 | |
| | | 3 | RemoveNewLinesCommand command = new RemoveNewLinesCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)); |
3 | new InQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session, _plugin)).execute(); | | 4 | |
Precondition Violations (3)
Row |
Violation |
1 | 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 |
2 | Expression new InQuotesCommand(FrameWorkAcessor.getSQLPanelAPI(_session,_plugin)) cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression command cannot be parameterized, because it has dependencies to/from statements that will be extracted |