Document doc = _textArea.getDocument();
try
{
int start = 0;
if (select)
{
start = doc.getLength();
}
doc.insertString(doc.getLength(), sqlScript, null);
if (select)
{
setSelectionEnd(doc.getLength());
setSelectionStart(start);
}
triggerParser();
} catch (Exception ex)
{
s_log.error("Error appending text to text area", ex);
}
Document doc = _textArea.getDocument();
try
{
int start = 0;
if (select)
{
start = doc.getLength();
}
doc.insertString(doc.getLength(), sqlScript, null);
if (select)
{
setSelectionEnd(doc.getLength());
setSelectionStart(start);
}
}
catch (Exception ex)
{
s_log.error("Error appending text to text area", ex);
}
Clone fragments detected by clone detection tool
File path: /sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/netbeans/NetbeansSQLEntryPanel.java
|
|
File path: /sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/oster/OsterSQLEntryPanel.java
|
Method name: void appendText(String, boolean)
|
|
Method name: void appendText(String, boolean)
|
Number of AST nodes: 10
|
|
Number of AST nodes: 9
|
|
1 | Document doc = _textArea.getDocument();↵ | | 1 | Document doc = _textArea.getDocument();↵
|
|
2 | try↵ | | 2 | try↵
|
3 | {↵ | | 3 | {↵
|
4 | int start = 0;↵ | | 4 | int start = 0;↵
|
5 | if (select)↵ | | 5 | if (select)↵
|
6 | {↵ | | 6 | {↵
|
7 | start = doc.getLength();↵ | | 7 | start = doc.getLength();↵
|
8 | }↵ | | 8 | }↵
|
|
9 | doc.insertString(doc.getLength(), sqlScript, null);↵ | | 9 | doc.insertString(doc.getLength(), sqlScript, null);↵
|
|
10 | if (select)↵ | | 10 | if (select)↵
|
11 | {↵ | | 11 | {↵
|
12 | setSelectionEnd(doc.getLength());↵ | | 12 | setSelectionEnd(doc.getLength());↵
|
13 | setSelectionStart(start);↵ | | 13 | setSelectionStart(start);↵
|
14 | }↵ | | 14 | }↵
|
|
15 | triggerParser();↵ | | 15 | ↵
|
| | | 16 | }↵
|
16 | } catch (Exception ex)↵ | | 17 | catch (Exception ex)↵
|
17 | {↵ | | 18 | {↵
|
18 | s_log.error("Error appending text to text area", ex);↵ | | 19 | s_log.error("Error appending text to text area", ex);↵
|
19 | } | | 20 | }
|
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.5 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 33 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 9 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 4.3 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | Document doc = _textArea.getDocument(); | | 1 | Document doc = _textArea.getDocument(); |
2 | try | | 2 | try |
3 | | | 3 | |
4 | | | 4 | |
5 | | | 5 | |
6 | doc.insertString(doc.getLength(), sqlScript, null); | | 6 | doc.insertString(doc.getLength(), sqlScript, null); |
7 | | | 7 | |
8 | setSelectionEnd(doc.getLength()); | | 8 | setSelectionEnd(doc.getLength()); |
9 | setSelectionStart(start); | | 9 | setSelectionStart(start); |
10 | | | | |
Precondition Violations (0)
Row |
Violation |