char ch = OUT_OF_BOUNDS; 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) { } return ch; } public boolean move(int index) { // move read position [index] clicks from 'charAt(0)' boolean retval = true; while (retval && (index-- > 0)) retval = next(); return retval; } public boolean isValid() { return (cached != OUT_OF_BOUNDS); }
char ch = OUT_OF_BOUNDS; 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) { } return ch; } public boolean move(int index) { // move read position [index] clicks from 'charAt(0)' boolean retval = true; while (retval && (index-- > 0)) retval = next(); return retval; } public boolean isValid() { return (cached != OUT_OF_BOUNDS); }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/gnu/regexp/CharIndexedReader.java File path: /jEdit-4.2/src/gnu/regexp/CharIndexedInputStream.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
char ch = OUT_OF_BOUNDS;
1
char ch = OUT_OF_BOUNDS;
2
	
2
	
3
	try {
3
	try {
4
	    int i = br.read();
4
	    int i = br.read();
5
	    this.index = index+1; // this.index is index of next pos relative to charAt(0)
5
	    this.index = index+1; // this.index is index of next pos relative to charAt(0)
6
	    if (i == -1) {
6
	    if (i == -1) {
7
		// set flag that next should fail next time?
7
		// set flag that next should fail next time?
8
		end = index;
8
		end = index;
9
		return ch;
9
		return ch;
10
	    }
10
	    }
11
	    ch = (char) i;
11
	    ch = (char) i;
12
	} catch (IOException ie) { }
12
	} catch (IOException ie) { }
13
	
13
	
14
	return ch;
14
	return ch;
15
    }
15
    }
16
    
16
    
17
    public boolean move(int index) {
17
    public boolean move(int index) {
18
	// move read position [index] clicks from 'charAt(0)'
18
	// move read position [index] clicks from 'charAt(0)'
19
	boolean retval = true;
19
	boolean retval = true;
20
	while (retval && (index-- > 0)) retval = next();
20
	while (retval && (index-- > 0)) retval = next();
21
	return retval;
21
	return retval;
22
    }
22
    }
23
    
23
    
24
    public boolean isValid() {
24
    public boolean isValid() {
25
	return (cached != OUT_OF_BOUNDS);
25
	return (cached != OUT_OF_BOUNDS);
26
    }
26
    }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0