if (index != -1) { br.reset(); } int i = br.read(); br.mark(bufsize); if (i == -1) { end = 1; cached = OUT_OF_BOUNDS; return false; } cached = (char) i; index = 1;
if (index != -1) { br.reset(); } int i = br.read(); br.mark(bufsize); if (i == -1) { end = 1; cached = OUT_OF_BOUNDS; return false; } // convert the byte read into a char cached = (char) i; index = 1;
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: boolean next() Method name: boolean next()
Number of AST nodes: 10 Number of AST nodes: 10
1
if (index != -1) {
1
if (index != -1) {
2
		br.reset();
2
		br.reset();
3
	    }
3
	    }
4
	    int i = br.read();
4
	    int i = br.read();
5
	    br.mark(bufsize);
5
	    br.mark(bufsize);
6
	    if (i == -1) {
6
	    if (i == -1) {
7
		end = 1;
7
		end = 1;
8
		cached = OUT_OF_BOUNDS;
8
		cached = OUT_OF_BOUNDS;
9
		return false;
9
		return false;
10
	    }
10
	    }
11
	    // convert the byte read into a char
11
	    cached = (char) i;
12
	    cached = (char) i;
12
	    index = 1;
13
	    index = 1;
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.8
Clones locationClones are in different classes
Number of node comparisons30
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements10
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)4.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    5
    if (index != -1)
    8
    if (index != -1)
    6
    br.reset();
    6
    br.reset();
    9
    br.reset();
    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 void reset() throws java.io.IOException
    9
    br.reset();
    7
    int i = br.read();
    7
    int i = br.read();
    10
    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
    10
    int i = br.read();
    8
    br.mark(bufsize);
    8
    br.mark(bufsize);
    11
    br.mark(bufsize);
    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 void mark(int)
    11
    br.mark(bufsize);
    9
    if (i == -1)
    12
    if (i == -1)
    10
    end = 1;
    13
    end = 1;
    11
    cached = OUT_OF_BOUNDS;
    14
    cached = OUT_OF_BOUNDS;
    12
    return false;
    15
    return false;
    13
    cached = (char)i;
    16
    cached = (char)i;
    14
    index = 1;
    17
    index = 1;
    Precondition Violations (4)
    Row Violation
    1Expression br cannot be unified with expression br , because common superclass java.io.Closeable does not declare member(s) public synchronized void reset() throws java.io.IOException
    2Expression 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
    3Expression br cannot be unified with expression br , because common superclass java.io.Closeable does not declare member(s) public synchronized void mark(int)
    4Not all possible execution flows end in a return statement