if (position < document.getLength()) { try { char c = document.getText((int) position, 1).charAt(0); position++; return c; } catch (BadLocationException x) { return -1; } } else { return -1; }
if (position < document.getLength()) { try { char c = document.getText((int) position, 1).charAt(0); position++; return c; } catch (BadLocationException x) { return -1; } } else { return -1; }
Clone fragments detected by clone detection tool
File path: /sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/oster/DocReader.java File path: /sql12/plugins/syntax/src/net/sourceforge/squirrel_sql/plugins/syntax/oster/OsterTextControl.java
Method name: int read() Method name: int read()
Number of AST nodes: 6 Number of AST nodes: 6
1
if (position < document.getLength())
1
if (position < document.getLength())
2
		{
2
			{
3
			try
3
				try
4
			{
4
				{
5
				char c = document.getText((int) position, 1).charAt(0);
5
					char c = document.getText((int) position, 1).charAt(0);
6
				position++;
6
					position++;
7
				return c;
7
					return c;
8
			}
8
				}
9
			catch (BadLocationException x)
9
				catch (BadLocationException x)
10
			{
10
				{
11
				return -1;
11
					return -1;
12
			}
12
				}
13
		}
13
			}
14
		else
14
			else
15
		{
15
			{
16
			return -1;
16
				return -1;
17
		}
17
			}
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.3
Clones locationClones are in different classes having the same super class
Number of node comparisons20
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    1
    if (position < document.getLength())
    1
    if (position < document.getLength())
    2
    try
    2
    try
    3
    char c = document.getText((int)position, 1).charAt(0);
    3
    char c = document.getText((int)position, 1).charAt(0);
    4
    position++;
    4
    position++;
    5
    return c;
    5
    return c;
    else
    else
    6
    return -1;
    6
    return -1;
    Precondition Violations (1)
    Row Violation
    1Not all possible execution flows end in a return statement