CloneSet3


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
53210.993class_body_declarations[4]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
15466
E:/TSE/Projects-CloneDR/jEdit-4.2/src/gnu/regexp/REFilterInputStream.java
25363
E:/TSE/Projects-CloneDR/jEdit-4.2/src/gnu/regexp/REFilterReader.java
Next
Last
Clone Instance
1
Line Count
54
Source Line
66
Source File
E:/TSE/Projects-CloneDR/jEdit-4.2/src/gnu/regexp/REFilterInputStream.java

/**
 * Reads the next byte from the stream per the general contract of
 * InputStream.read().  Returns -1 on error or end of stream.
 */
public int read() {
  // If we have buffered replace data, use it.
  if ((buffer != null) && (bufpos < buffer.length())) {
    return (int) buffer.charAt(bufpos++);
  }
  // check if input is at a valid position
  if ( !stream.isValid())
    return -1;
  REMatch mymatch = new REMatch(expr.getNumSubs(), offset, 0);
  if (expr.match(stream, mymatch)) {
    mymatch.end[0] = mymatch.index;
    mymatch.finish(stream);
    stream.move(mymatch.toString().length());
    offset += mymatch.toString().length();
    buffer = mymatch.substituteInto(replace);
    bufpos = 1;
    // This is prone to infinite loops if replace string turns out empty.
    if (buffer.length() > 0) {
      return buffer.charAt(0);
    }
  }
  char ch = stream.charAt(0);
  if (ch == CharIndexed.OUT_OF_BOUNDS)
    return -1;
  stream.move(1);
  offset++;
  return ch;
}

/** 
 * Returns false.  REFilterInputStream does not support mark() and
 * reset() methods. 
 */
public boolean markSupported() {
  return false;
}

/** Reads from the stream into the provided array. */
public int read(byte[] b, int off, int len) {
  int i;
  int ok = 0;
  while (len-- > 0) {
    i = read();
    if (i == -1)
      return (ok == 0) ? -1: ok;
    b[off++ ] = (byte) i;
    ok++;
  }
  return ok;
}

/** Reads from the stream into the provided array. */
public int read(byte[] b) {
  return read(b, 0, b.length);
}


First
Previous
Clone Instance
2
Line Count
53
Source Line
63
Source File
E:/TSE/Projects-CloneDR/jEdit-4.2/src/gnu/regexp/REFilterReader.java

/**
 * Reads the next character from the stream per the general contract of
 * Reader.read().  Returns -1 on error or end of stream.
 */
public int read() {
  // If we have buffered replace data, use it.
  if ((buffer != null) && (bufpos < buffer.length())) {
    return (int) buffer.charAt(bufpos++);
  }
  // check if input is at a valid position
  if ( !stream.isValid())
    return -1;
  REMatch mymatch = new REMatch(expr.getNumSubs(), offset, 0);
  if (expr.match(stream, mymatch)) {
    mymatch.end[0] = mymatch.index;
    mymatch.finish(stream);
    stream.move(mymatch.toString().length());
    offset += mymatch.toString().length();
    buffer = mymatch.substituteInto(replace);
    bufpos = 1;
    if (buffer.length() > 0) {
      return buffer.charAt(0);
    }
  }
  char ch = stream.charAt(0);
  if (ch == CharIndexed.OUT_OF_BOUNDS)
    return -1;
  stream.move(1);
  offset++;
  return ch;
}

/** 
 * Returns false.  REFilterReader does not support mark() and
 * reset() methods. 
 */
public boolean markSupported() {
  return false;
}

/** Reads from the stream into the provided array. */
public int read(char[] b, int off, int len) {
  int i;
  int ok = 0;
  while (len-- > 0) {
    i = read();
    if (i == -1)
      return (ok == 0) ? -1: ok;
    b[off++ ] = (char) i;
    ok++;
  }
  return ok;
}

/** Reads from the stream into the provided array. */
public int read(char[] b) {
  return read(b, 0, b.length);
}


Clone AbstractionParameter Count: 1Parameter Bindings

/**
   * Reads the next character from the stream per the general contract of
   * Reader.read().  Returns -1 on error or end of stream.
   */
/**
   * Reads the next byte from the stream per the general contract of
   * InputStream.read().  Returns -1 on error or end of stream.
   */
public int read() {
  // If we have buffered replace data, use it.
  if ((buffer != null) && (bufpos < buffer.length())) {
    return (int) buffer.charAt(bufpos++);
  }
  // check if input is at a valid position
  if ( !stream.isValid())
    return -1;
  REMatch mymatch = new REMatch(expr.getNumSubs(), offset, 0);
  if (expr.match(stream, mymatch)) {
    mymatch.end[0] = mymatch.index;
    mymatch.finish(stream);
    stream.move(mymatch.toString().length());
    offset += mymatch.toString().length();
    buffer = mymatch.substituteInto(replace);
    bufpos = 1;
    // This is prone to infinite loops if replace string turns out empty.
    if (buffer.length() > 0) {
      return buffer.charAt(0);
    }
  }
  char ch = stream.charAt(0);
  if (ch == CharIndexed.OUT_OF_BOUNDS)
    return -1;
  stream.move(1);
  offset++;
  return ch;
}

/** 
   * Returns false.  REFilterReader does not support mark() and
   * reset() methods. 
   */
/** 
   * Returns false.  REFilterInputStream does not support mark() and
   * reset() methods. 
   */
public boolean markSupported() {
  return false;
}

/** Reads from the stream into the provided array. */
public int read( [[#variablee24cdc0]][] b, int off, int len) {
  int i;
  int ok = 0;
  while (len-- > 0) {
    i = read();
    if (i == -1)
      return (ok == 0) ? -1: ok;
    b[off++ ] = ( [[#variablee24cdc0]]) i;
    ok++;
  }
  return ok;
}

/** Reads from the stream into the provided array. */
public int read( [[#variablee24cdc0]][] b) {
  return read(b, 0, b.length);
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#e24cdc0]]
byte 
12[[#e24cdc0]]
char