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
		}
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.5
Clones locationClones are in different classes having the same super class
Number of node comparisons33
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements9
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.3
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    Document doc = _textArea.getDocument();
    1
    Document doc = _textArea.getDocument();
    1
    Document doc = _textArea.getDocument();
    Differences
    Expression1Expression2Difference
    net.sourceforge.squirrel_sql.plugins.syntax.netbeans.NetbeansSQLEditorPanenet.sourceforge.squirrel_sql.plugins.syntax.oster.OsterTextControlSUBCLASS_TYPE_MISMATCH
    1
    Document doc = _textArea.getDocument();
    2
    try
    2
    try
    3
    int start = 0;
    3
    int start = 0;
    4
    if (select)
    4
    if (select)
    5
    start = doc.getLength();
    5
    start = doc.getLength();
    6
    doc.insertString(doc.getLength(), sqlScript, null);
    6
    doc.insertString(doc.getLength(), sqlScript, null);
    7
    if (select)
    7
    if (select)
    8
    setSelectionEnd(doc.getLength());
    8
    setSelectionEnd(doc.getLength());
    9
    setSelectionStart(start);
    9
    setSelectionStart(start);
    10
    triggerParser();
                                            
    Precondition Violations (0)
    Row Violation