try { int i = br.read(); this.index = index+1; // this.index is index of next pos relative to charAt(0) if (i == -1) { // set flag that next should fail next time? end = index; return ch; } ch = (char) i; } catch (IOException ie) { }
try { int i = br.read(); this.index = index+1; // this.index is index of next pos relative to charAt(0) if (i == -1) { // set flag that next should fail next time? end = index; return ch; } ch = (char) i; } catch (IOException ie) { }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/gnu/regexp/CharIndexedInputStream.java File path: /jEdit-4.2/src/gnu/regexp/CharIndexedReader.java
Method name: char charAt(int) Method name: char charAt(int)
Number of AST nodes: 7 Number of AST nodes: 7
1
try {
1
try {
2
	    int i = br.read();
2
	    int i = br.read();
3
	    this.index = index+1; // this.index is index of next pos relative to charAt(0)
3
	    this.index = index+1; // this.index is index of next pos relative to charAt(0)
4
	    if (i == -1) {
4
	    if (i == -1) {
5
		// set flag that next should fail next time?
5
		// set flag that next should fail next time?
6
		end = index;
6
		end = index;
7
		return ch;
7
		return ch;
8
	    }
8
	    }
9
	    ch = (char) i;
9
	    ch = (char) i;
10
	} catch (IOException ie) { }
10
	} catch (IOException ie) { }
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.2
Clones locationClones are in different classes
Number of node comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    23
    try
    23
    try
    24
    int i = br.read();
    24
    int i = br.read();
    24
    int i = br.read();
    Differences
    Expression1Expression2Difference
    java.io.BufferedInputStreamjava.io.BufferedReaderSUBCLASS_TYPE_MISMATCH
    Preondition Violations
    Expression br cannot be unified with expression br , because common superclass java.io.Closeable does not declare member(s) public synchronized int read() throws java.io.IOException
    24
    int i = br.read();
    25
    this.index = index + 1;
    25
    this.index = index + 1;
    26
    if (i == -1)
    26
    if (i == -1)
    27
    end = index;
    27
    end = index;
    28
    return ch;
    28
    return ch;
    29
    ch = (char)i;
    29
    ch = (char)i;
    Precondition Violations (2)
    Row Violation
    1Expression br cannot be unified with expression br , because common superclass java.io.Closeable does not declare member(s) public synchronized int read() throws java.io.IOException
    2Not all possible execution flows end in a return statement